package aic.ws;

import aic.beans.Address;
import aic.beans.Customer;
import aic.beans.Item;
import aic.beans.Order;
import aic.beans.Payment_Preference;
import aic.lists.AddressList;
import aic.lists.AvailableItemsList;
import aic.lists.CustomerList;
import aic.lists.OrderList;
import aic.misc.DebugPrint;
import java.math.BigDecimal;
import javax.jws.WebService;

//@WebService(portName = "CreateDataPT", targetNamespace = "http://infosys.tuwien.ac.at/ait09/ass1/dto/createData", endpointInterface = "aic.ws.CreateDataService", serviceName = "CreateDataService")
@WebService(portName = "CreateDataPT", endpointInterface = "aic.ws.CreateDataService", serviceName = "CreateDataService")
public class CreateDataServiceImpl implements CreateDataService {

    public Customer create_customer(String name, Address address) {
        DebugPrint.println("creating and adding new Customer..");
        Customer customer = new Customer();
        customer.setName(name);
        customer.setAddress(address);
//        customer.setPayment_preference(payment_preference);
        CustomerList.add(customer);
        CustomerList.printList();
        DebugPrint.println("..creating and adding new Customer done!");
        return customer;
    }

    public Address create_address(String street, String city, int house, int door, String zip_code) {
        DebugPrint.println("creating and adding new Address..");
        Address address = new Address();
        address.setStreet(street);
        address.setCity(city);
        address.setHouse(house);
        address.setDoor(door);
        address.setZip_code(zip_code);
        AddressList.add(address);
        AddressList.printList();
        DebugPrint.println("..creating and adding new Address done!");
        return address;
    }

//    public Item create_available_item(int quantity, BigDecimal single_unit_price) {
//        DebugPrint.println("creating and adding new available Item..");
//        Item item = new Item();
//        item.setQuantity(quantity);
//        item.setSingle_unit_price(single_unit_price);
//        AvailableItemsList.add(item);
//        DebugPrint.println("..creating and adding new available Item done!");
//        return item;
//    }

    public Order create_order() {
        DebugPrint.println("creating and adding new Order..");
        Order order = new Order();
        OrderList.add(order);
        OrderList.printList();
        DebugPrint.println("..creating and adding new Order done!");
        return order;
    }
}
